/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author HOATNM
 */
public class ValidateText {

    // check name and desciption
    public static boolean checkNameAndDecript(String text) {
        if (text.equals("")) {
            return false;
        }
        Pattern pattern;
        Matcher matcher;
        String PATTERN = "^[A-Za-z0-9_-]{3,15}$";
        pattern = Pattern.compile(PATTERN);
        matcher = pattern.matcher(text);
        return matcher.matches();
    }
}
